function clearMessages(divId) {
  var div = document.getElementById(divId);
  div.style.cssText = "";
  div.innerHTML = "";
}

function printMessage(message) {
  document.getElementById("message").innerHTML = "<span>" + message + "</span>";
}

function printReply(jsonStr) {
  var obj = eval('(' + jsonStr + ')');
  if (obj.type == 1) {// 成功提示
    document.getElementById("message").innerHTML = "<span>" + obj.message + "</span>";
  } else if (obj.type == 2) {// 错误提示
    document.getElementById("message").innerHTML = "<ul><li>" + obj.message + "</li></ul>";
  }
}

function isMessageReply(jsonStr) {
  var obj = eval('(' + jsonStr + ')');
  return (obj.type == 1);
}